	/**
 * 
 */
package net.thelostlands.shinycast;

import org.bukkit.entity.Player;

/**
 * @author sleaker
 *
 */
public class Permissions {


	public static enum Perms {
		ALL_MESSAGES("administrate.allmessages");
		String perm = null;
		
		Perms(String perm) {
			this.perm = perm;
		}

		public String getPerm() {
			return perm;
		}
	}

    public static boolean has(Player player, Perms perm) {
    	return Message.perms.has(player, perm.getPerm());
    }

    
    /*
     * Return an info double
     */
	public static double infoDouble(Player player, String nodeName) {
    	return Message.perms.getPlayerInfoDouble(player.getWorld().getName(), player.getName(), nodeName, -1);
    }
    



    /**
     * Warns the player they did not have permission for the command.
     * 
     * @param player
     */
    public static void noPermsMessage(Player player) {
        player.sendMessage("Con sommo rammarico non posso obbedirla, lei non dispone di permessi sufficienti.");
    }

}
